package com.yanqu.road.entity.autodata.chuhan.data;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.autodata.AutoDataObject;

import java.util.LinkedList;

@FieldTypeAnnotation(tableName = "t_c_chuhan_city")
public class CrossChuHanCityData extends AutoDataObject {
    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "活动分组ID", update = true)
    private int groupId;
    @FieldTypeAnnotation(desc = "城市id", update = true)
    private int cityId;
    @FieldTypeAnnotation(desc = "阵营")
    private int campId; // 阵营
    @FieldTypeAnnotation(desc = "守军数量")
    private int teamNum; // 守军数量
    @FieldTypeAnnotation(desc = "额外守军数量")
    private int extraTeamNum; // 额外守军数量
    @FieldTypeAnnotation(desc = "每个守军队伍人数")
    private long teamSoldierNum; // 每个守军队伍人数
    @FieldTypeAnnotation(desc = "占领时间")
    private long occupyTime; // 占领时间
    @FieldTypeAnnotation(desc = "上次结算采集奖励时间")
    private long collectionTime; // 上次结算采集奖励时间
    @FieldTypeAnnotation(desc = "城防军恢复开始时间")
    private long teamRecoveryBeginTime; // 城防军恢复开始时间，0表示不恢复
    @FieldTypeAnnotation(desc = "打过几场战斗")
    private int battledNum; // 打过几场战斗
    @FieldTypeAnnotation(desc = "最后一次恢复额外守军的时间")
    private long lastRecoveryExtraTeamTime; // 最后一次恢复额外守军的时间

    // 新战斗相关
    @FieldTypeAnnotation(desc = "城防军恢复开始时间")
    private LinkedList<CrossChuHanTeamArrive> defTeamList = new LinkedList<>();
    @FieldTypeAnnotation(desc = "攻击方队伍到达时间")
    private LinkedList<CrossChuHanTeamArrive> atkTeamList = new LinkedList<>();
    @FieldTypeAnnotation(desc = "战斗场信息")
    private CrossChuHanBattlefield battlefield = null;

    public CrossChuHanCityData() {
    }

    public CrossChuHanCityData(int activityId, int groupId, int cityId) {
        this.activityId = activityId;
        this.groupId = groupId;
        this.cityId = cityId;
        setInsertOption();
    }

    // ====================


    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public int getCampId() {
        return campId;
    }

    public void setCampId(int campId) {
        this.campId = campId;
        setUpdateOption();
    }

    public int getTeamNum() {
        return teamNum;
    }

    public void setTeamNum(int teamNum) {
        this.teamNum = teamNum;
        setUpdateOption();
    }

    public long getTeamSoldierNum() {
        return teamSoldierNum;
    }

    public void setTeamSoldierNum(long teamSoldierNum) {
        this.teamSoldierNum = teamSoldierNum;
        setUpdateOption();
    }

    public long getOccupyTime() {
        return occupyTime;
    }

    public void setOccupyTime(long occupyTime) {
        this.occupyTime = occupyTime;
        setUpdateOption();
    }

    public long getCollectionTime() {
        return collectionTime;
    }

    public void setCollectionTime(long collectionTime) {
        this.collectionTime = collectionTime;
        setUpdateOption();
    }

    public LinkedList<CrossChuHanTeamArrive> getDefTeamList() {
        return defTeamList;
    }

    public CrossChuHanTeamArrive removeDefTeamFirst() {
        return defTeamList.removeFirst();
    }

    public void addDefTeamFirst(CrossChuHanTeamArrive team) {
        defTeamList.addFirst(team);
        setUpdateOption();
    }

    public void addDefTeamLast(CrossChuHanTeamArrive team){
        defTeamList.addLast(team);
        setUpdateOption();
    }

    public void removeDefTeam(CrossChuHanTeamArrive team) {
        defTeamList.remove(team);
        setUpdateOption();
    }

    public void setDefTeamList(LinkedList<CrossChuHanTeamArrive> defTeamList) {
        this.defTeamList = defTeamList;
        setUpdateOption();
    }

    public LinkedList<CrossChuHanTeamArrive> getAtkTeamList() {
        return atkTeamList;
    }

    public CrossChuHanTeamArrive removeAtkTeamFirst() {
        return atkTeamList.removeFirst();
    }

    public void addAtkTeamFirst(CrossChuHanTeamArrive team) {
        atkTeamList.addFirst(team);
        setUpdateOption();
    }

    public void addAtkTeamLast(CrossChuHanTeamArrive team){
        atkTeamList.addLast(team);
        setUpdateOption();
    }

    public void removeAtkTeam(CrossChuHanTeamArrive team) {
        atkTeamList.remove(team);
        setUpdateOption();
    }

    public void setAtkTeamList(LinkedList<CrossChuHanTeamArrive> atkTeamList) {
        this.atkTeamList = atkTeamList;
        setUpdateOption();
    }

    public CrossChuHanBattlefield getBattlefield() {
        return battlefield;
    }

    public void setBattlefield(CrossChuHanBattlefield battlefield) {
        this.battlefield = battlefield;
        setUpdateOption();
    }

    public long getTeamRecoveryBeginTime() {
        return teamRecoveryBeginTime;
    }

    public void setTeamRecoveryBeginTime(long teamRecoveryBeginTime) {
        this.teamRecoveryBeginTime = teamRecoveryBeginTime;
        setUpdateOption();
    }

    public int getBattledNum() {
        return battledNum;
    }

    public void setBattledNum(int battledNum) {
        this.battledNum = battledNum;
        setUpdateOption();
    }

    public int getExtraTeamNum() {
        return extraTeamNum;
    }

    public void setExtraTeamNum(int extraTeamNum) {
        this.extraTeamNum = extraTeamNum;
        setUpdateOption();
    }

    public long getLastRecoveryExtraTeamTime() {
        return lastRecoveryExtraTeamTime;
    }

    public void setLastRecoveryExtraTeamTime(long lastRecoveryExtraTeamTime) {
        this.lastRecoveryExtraTeamTime = lastRecoveryExtraTeamTime;
        setUpdateOption();
    }
}
